import request from '@/utils/request'

export function login(data) {
  return request(
    {
      url: '/sys/login',
      method: 'post',
      data
    }
  )
}
// 获取基本信息
export function getUserInfo() {
  return request(
    {
      url: '/sys/profile',
      method: 'post'
    }
  )
}
// 获取头像等详细信息
export function getUserDetail(id) {
  return request(
    {
      url: '/sys/user/' + id,
      method: 'get'
    }
  )
}

export function logout() {
  return request()
}

// 更新用户信息
export function updateUser(data) {
  return request(
    {
      url: '/sys/user/' + data.id,
      method: 'put',
      data
    }
  )
}

// 获取员工基本信息
export function getUserBaseInfo(id) {
  return request(
    {
      url: `/employees/${id}/personalInfo`
    }
  )
}
